home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / appsrcs.zip / APPBAR.ZIP / APPBAR.H < prev    next >
C/C++ Source or Header  |  1993-06-10  |  8KB  |  252 lines

  1. /* appbar.h */
  2.  
  3. #include <mmsystem.h>
  4.  
  5. #define WM_APPBAR_RESTART   (WM_USER+1001)
  6. #define WM_APPBAR_CLOSE        (WM_USER+1002)
  7. #define PM_TIP_SETICON        (WM_USER+1100)
  8.  
  9. #define ID_TIMER      100
  10.  
  11. #define SYSTEM_BUTTON      0
  12.  
  13. #define ID_CLOSE    400
  14. #define ID_ABOUT    401
  15. #define ID_MOVE        402
  16. #define ID_OK        403
  17. #define ID_CANCEL    404
  18. #define ID_SETUP    405
  19. #define ID_RESTART    406
  20. #define ID_QUICKLOAD    407
  21. #define ID_RUN        408
  22. #define ID_MINIMIZE    409
  23. #define ID_HELP        410
  24. #define ID_INFRONT    411
  25.  
  26. #define IDEXITW_YES    500
  27. #define IDEXITW_NO    501
  28. #define IDEXITW_RESTART    502
  29.  
  30. #define IDRUN_PROGRAM    600
  31. #define IDRUN_CANCEL    601
  32. #define IDRUN_OK    602
  33. #define IDRUN_BROWSE    603
  34.  
  35. #define IDMOVE_YES    700
  36. #define IDMOVE_NO    701
  37.  
  38. #define IDASK_PARAMS    800
  39. #define IDASK_CANCEL    801
  40. #define IDASK_OK    802
  41.  
  42. #define ID_BUTTON1    1000
  43.  
  44. #define INI_SYSTEM    "System"
  45. #define INI_BUTTON    "Buttons"
  46. #define INI_SOUND    "Sounds"
  47. #define INI_FILE    "appbar.ini"
  48.  
  49. #define LEFT        "Left"
  50. #define TOP        "Top"
  51. #define COLUMNS        "Columns"
  52. #define BUTTONS     "Buttons"
  53. #define CLOSEALL    "CloseAll"
  54. #define STAYINFRONT    "StayInFront"
  55. #define INITIALIZED    "Initialized"
  56. #define BIGBUTTONS    "BigButtons"
  57. #define DOUBLECLICK    "DoubleClick"
  58. #define BORDER        "Border"
  59.  
  60. #define SOUNDENABLE    "EnableSound"
  61. #define APPSTART    "AppBarStart"
  62. #define APPEXIT     "AppBarExit"
  63. #define WINEXIT     "WindowsExit"
  64. #define PROGSTART    "ProgramStart"
  65. #define PROGCLOSE    "ProgramClose"
  66. #define DROPFILE    "DropFile"
  67. #define ERRORMESSAGE    "ErrorMessage"
  68.  
  69. #define LEFT_DEFAULT        "-1"
  70. #define TOP_DEFAULT        "-1"
  71. #define COLUMNS_DEFAULT        "1"
  72. #define BUTTONS_DEFAULT     "8"
  73. #define CLOSEALL_DEFAULT    "1"
  74. #define NOSOUND_DEFAULT     "0"
  75. #define CLOSEPROG_DEFAULT   "1"
  76. #define SHOWMODE_DEFAULT    "0"
  77. #define STAYINFRONT_DEFAULT "0"
  78. #define INITIALIZED_DEFAULT "0"
  79. #define ICONNUMBER_DEFAULT  "0"
  80. #define BUTTONLOOK_DEFAULT  "0"
  81. #define BIGBUTTONS_DEFAULT  "0"
  82. #define DOUBLECLICK_DEFAULT "0"
  83. #define BORDER_DEFAULT        "0"
  84.  
  85. #define SOUNDENABLE_DEFAULT    "0"
  86. #define APPSTART_DEFAULT    "<none>"
  87. #define APPEXIT_DEFAULT        "<none>"
  88. #define WINEXIT_DEFAULT        "<none>"
  89. #define PROGSTART_DEFAULT    "<none>"
  90. #define PROGCLOSE_DEFAULT    "<none>"
  91. #define DROPFILE_DEFAULT    "<none>"
  92. #define ERRORMESSAGE_DEFAULT    "<none>"
  93.  
  94. #define MAXFILECHARS    81 //DOS sets max of file to 80 chars
  95. #define MAXDIGITS    5
  96. #define NUMICONS    4
  97. #define NUMEDITS    3
  98. #define MAXBUTTONS    49
  99. #define MAXAPPS     (MAXBUTTONS-1)
  100. #define MAXRES        1280
  101. #define MAXBORDER    15
  102.  
  103. #define APPBARVERSION    400
  104. #define APPBAR4        400
  105.  
  106. typedef struct {
  107.        int    nColumns;
  108.        int    nButtons;
  109.        int    cxButton;
  110.        int    cyButton;
  111.        } APPWINDOW;
  112.  
  113. typedef enum {NOTALIVE = FALSE, ALIVE = TRUE} STATUS;
  114.  
  115. typedef struct {
  116.     char    IcoName[MAXFILECHARS];
  117.     char    ProgName[MAXFILECHARS];
  118.     char    StartDir[MAXFILECHARS];
  119.     char    Params[MAXFILECHARS];
  120.     HWND    hWndApp;
  121.     int    IconNumber;
  122.     BOOL    ButtonLook;
  123.     STATUS    ProgStatus;
  124.     BOOL    Close;
  125.     short    ShowMode;
  126.     BOOL    NoSound;
  127.     } APPBARBUTTONS;
  128.  
  129. typedef struct {
  130.     short    Left;
  131.     short    Top;
  132.     int    Columns;
  133.     int    Buttons;
  134.     BOOL    CloseAll;
  135.     BOOL    StayInFront;
  136.     int    Initialized;
  137.     BOOL    BigButtons;
  138.     BOOL    DoubleClick;
  139.     int    Border;
  140.     char    DefaultIconDir[MAXFILECHARS];
  141.     char    ShellGroup[8*MAXFILECHARS];
  142.     } APPSYSTEM;
  143.  
  144. typedef struct {
  145.     BOOL    EnableSound;
  146.     char    AppBarStart[MAXFILECHARS];
  147.     char    AppBarExit[MAXFILECHARS];
  148.     char    WindowsExit[MAXFILECHARS];
  149.     char    ProgramStart[MAXFILECHARS];
  150.     char    ProgramClose[MAXFILECHARS];
  151.     char    DropFile[MAXFILECHARS];
  152.     char    ErrorMessage[MAXFILECHARS];
  153.     char    SoundDirectory[MAXFILECHARS];
  154.     } APPSOUND;
  155.  
  156. typedef struct {
  157.     int left;
  158.     int top;
  159.     int width;
  160.     int height;
  161.     } APPMAXSIZE;
  162.  
  163. char szBuffer[256];
  164. int temp;
  165.  
  166. #define WITHIN(val, min, max)      (((temp=val) > max ? max : (temp < min) ? min : temp))
  167. #define ONEORZERO(val)          WITHIN((BOOL)val, 0, 1)
  168.  
  169. extern APPBARBUTTONS    AppButton[MAXAPPS], AppEmptyButton;
  170. extern APPSYSTEM    AppSystem;
  171. extern APPWINDOW    AppWindow;
  172. extern APPSOUND     AppSound;
  173. extern APPMAXSIZE    AppMaxSize;
  174. extern HWND        hWndMain, hWndCurrentButton, hWndButton[MAXBUTTONS];
  175. extern HINSTANCE    hInst;
  176. extern HBITMAP        hAppLogo, hNNever;
  177. extern HBITMAP        hbPressed, hbBlank, hbKeyb;
  178. extern HICON        hSystem, hBlank, hPressed, hQuickLoad;
  179. extern HICON        hRun, hKeybOn, hPressed2, hSystem2;
  180. extern int        iCurrent, iKey, iActive, cxChar, cyChar, FirstAppButton;
  181. extern char        szError[256];
  182. extern BOOL        bQuickLoad, bMoveButton;
  183. extern BOOL        bKeyboardOn, bExecuteProg, bShuffleButton;
  184.  
  185.  
  186. /* defined in AppBar.c */
  187. extern    int  PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow);
  188. extern    long WINAPI WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  189.  
  190. /* defined in AppTools.c*/
  191. extern VOID OkMsgBox(char *szCaption, char *szFormat, ...);
  192. extern VOID ErrorMsgBox(char *szCaption, char *szFormat, ...);
  193. extern VOID PASCAL IniRead(VOID);
  194. extern APPMAXSIZE CalculateAppMaxSize(VOID);
  195. extern VOID SetNormalChildCursor(VOID);
  196. extern VOID SetShuffleChildCursor(VOID);
  197. extern void InitTip(void);
  198. extern BOOL IsAppTip(int AppNumber);
  199. extern void LoadAllButtonIcons(HICON *hIcon);
  200. extern void TipSetIcon(WORD iIcon, HICON *hIcon);
  201. extern void LoadAppBarResources(void);
  202. extern void FreeAppBarResources(void);
  203. extern BOOL IsAppBarShell(VOID);
  204.  
  205. /* defined in AppClose.c */
  206. //long WINAPI WaitForWMCloseWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  207. //VOID PASCAL WaitForWMClose(HWND hWndClose);
  208. //BOOL PASCAL CloseApp(HWND hWndClose);
  209.  
  210. /* defined in AppDlgs.c */
  211. extern BOOL WINAPI AboutDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  212. extern BOOL WINAPI SystemDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  213. extern BOOL WINAPI ExitWDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  214. extern BOOL WINAPI AskDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  215.  
  216. /* defined in AppExec.c */
  217. extern BOOL PASCAL ProgExec(HWND hWndParent, LPSTR lpszFile, LPSTR lpszParams, LPSTR lpszDir, int nCmdShow);
  218. extern VOID PASCAL StartOrCloseProgram(int,UINT);
  219. extern VOID DoShellTasks(VOID);
  220. extern VOID PASCAL CheckProgStatus(VOID);
  221. extern int AskForParameters(char *szParams);
  222.  
  223. /* defined in AppDraw.c */
  224. extern void DrawItem(LPDRAWITEMSTRUCT lpIconDIS, HICON *hIcon);
  225.  
  226. /* defined in AppGrp.c */
  227. extern BOOL ExecGroupFile(char *szGroupFileName);
  228. extern BOOL ReadGroupFile(LPSTR lpszGroupFileName, PHANDLE ghMemGroupFileData);
  229.  
  230. /* defined in AppKeyb.c */
  231. extern int KeyboardInterface(int Key);
  232. extern int ProcessSystemKeys(int SysKey);
  233.  
  234. /* defined in AppDrop.c */
  235. extern VOID ProcessDropFiles(HANDLE hDrop, HICON *hIcon);
  236.  
  237. /* Undocumented Windows function in taskman.exe (PCM/FEB92) */
  238. extern BOOL WINAPI IsWinOldApTask(HTASK);
  239.  
  240. #define IsDosWindow(hWnd)   IsWinOldApTask(GetWindowTask(hWnd))
  241.  
  242. /*defined in AppBar.dll */
  243. extern TEXTMETRIC WINAPI RetrieveTextMetrics(HWND hWnd);
  244. extern void WINAPI DrawBitmap(HDC hDC, short x, short y, HBITMAP hBitmap);
  245. extern APPSYSTEM  WINAPI ReadSystemIni(VOID);
  246. extern APPSOUND   WINAPI ReadSoundIni(VOID);
  247. extern APPBARBUTTONS WINAPI ReadButtonIni(int i, LPSTR SectionName, LPSTR IniFile);
  248. extern VOID WINAPI SaveButtonIni(APPBARBUTTONS AppButton, int i, LPSTR SectionName, LPSTR IniFile);
  249. extern APPBARBUTTONS WINAPI InitButton(VOID);
  250. extern VOID WINAPI ExecuteErrorHandle(int iError, char *szError);
  251. extern BOOL WINAPI CloseApp(HWND hWndClose, HINSTANCE hInst);
  252.